<!--#begin imageslisteditor -->

<script type="text/javascript">
<!--
var prevpath = '';

function onOK(url) {
	var alt = document.getElementById('f_alt');
	var ali = document.getElementById('align');
	var border = document.getElementById('f_border');
	var horiz = document.getElementById('f_horiz');
	var vert = document.getElementById('f_vert');
	var param = new Object();

    param['f_id'] = '';
    param['f_url'] = url;
	param['f_alt'] = alt.value;
	param['f_align'] = ali.value;
	param['f_border'] = border.value;
	param['f_horiz'] = horiz.value;
	param['f_vert'] = vert.value;


	opener.bab_dialog._return({
		'callback' 	: 'EditorOnCreateImage',
		'param'		: param
	});
	
	window.close();
    return false;
};

function validateNum(field) {
var valid = "0123456789"
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}
if (ok == "no") {
var d2;
alert("{ invalidentry }");
field.value = field.value.substring(0, i-1);
field.focus();
return false;
   }
return true;
}

function validateImage(fmname, msg)
{
pat = /\./
txt = document.forms[fmname].uploadf.value;
list = txt.split(pat);
ext = new String("");
if( list.length > 1 )
	ext = list[list.length - 1];
ext = ext.toLowerCase();
if(  ext == "" || (ext != "jpg" && ext != "jpeg" && ext != "png" && ext != "gif") )
	{
	alert(msg + " < " + ext +" >");
	return false;
	}
else
	{
	document.forms[fmname].submit();
	return true;
	}
}

function putpath(path)
{
var sp = document.getElementById('sp');
sp.innerHTML = path;
document.forms.fmadd.path.value = path;
}

function make_dir()
{
if (document.getElementById('files_frame').contentDocument){
	var frameform = document.getElementById('files_frame').contentDocument.forms['add_directory'];
  } else {
    var frameform = document.frames['files_frame'].document.forms['add_directory'];
  }
var directory = document.getElementById('directory');
frameform.directory.value = directory.value;
frameform.post_message.click();
directory.value = '';
}


function frameloc(url)
{
if (document.getElementById('files_frame').contentDocument){
    document.getElementById('files_frame').contentDocument.location.href = url;
  } else {
    document.frames['files_frame'].location.href = url;
  }
}

window.focus();
//-->
</script>




<br>

<!--#if upload -->

<form name="fmadd" method="post" action="{ babPhpSelf }" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="{ maximagessize }" />
<input type="hidden" name="tg" value="images" />
<input type="hidden" name="idx" value="list" />
<input type="hidden" name="path" value="" />
<input type="hidden" name="addf" value="add" />
<input type="hidden" name="linked_images" value="{ linked_images }" />


<table  width="90%" border="0" cellspacing="0" cellpadding="2" align="center">
<tr> 
<td class="BabLoginCadreBackground" align="center" valign="middle"> 
	<table class="BabLoginMenuBackground" width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
	<tr> 
	<td  colspan="2"  width="100%" align="center" nowrap valign="middle">{ maxsizetxt }</td>
	</td>
	</tr>
	<tr> 
	<td width="30%" align="right" nowrap valign="middle">{ file }</td>
	<td width="70%" valign="middle"> 
	<input type="file" name="uploadf" size="40" maxlength="255" value="">
	</td>
	</tr>
	<!--#if badmin -->
	<!--#if linked_images -->
	<tr> 
	<td width="30%" align="right" nowrap valign="middle">{ shared }</td>
	<td width="70%" valign="middle"> 
	<select name="share">
	<option value="Y">{ yes }</option>
	<option value="N" selected>{ no }</option>
	</select>
	</td>
	</tr>
	<!--#endif linked_images -->
	<!--#endif badmin -->
	<tr>
	<td nowrap>&nbsp;</td>
	<td valign="middle"> 
	<input type="button" value="{ add }" onClick="validateImage('fmadd', '{ invalidimg }')">
	</td>
	</tr>
	</table>
</td>
</tr>
</table>
</form>

<br>


<!--#endif upload -->

<form name="fdummy">
<center>
	<table class="BabLoginMenuBackground"  border="0" width="90%" cellpadding="3" cellspacing="0" align="center">
	<tr> 
		<td><a class="BabSiteAdminListLink" href="{ refurl }">{ refresh }</a></td>
		<td align="right" valign="middle">{ aligntxt }:</td>
		<td align="left" valign="middle"> 
			<select name="align" id="align">
			<option value="">{ none }</option>
			<option value="left">{ left }</option>
			<option value="right">{ right }</option>
			<option value="middle">{ middle }</option>
			<option value="absmiddle">{ absmiddle }</option>
			<option value="top">{ top }</option>
			<option value="bottom">{ bottom }</option>
			<option value="center">{ center }</option>
			</select>
		</td>
	</tr>
	<tr> 
		<td>&nbsp;</td>
		<td align="right"> { alt } : </td>
		<td align="left"> 
			<input type="text" id="f_alt" name="f_alt">
		</td>
	</tr>
	<tr> 
		<td>&nbsp;</td>
		<td align="right">{ hspacing } : </td>
		<td align="left"> 
			<input onKeyup="validateNum(this)" type="text" id="f_horiz" name="f_horiz">
		</td>
	</tr>
	<tr> 
		<td>&nbsp;</td>
		<td align="right">{ vspacing } : </td>
		<td align="left"> 
			<input onKeyup="validateNum(this)" type="text" id="f_vert" name="f_vert">
		</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td align="right">{ border } : </td>
		<td align="left">
			<input onKeyup="validateNum(this)" type="text" id="f_border" name="f_border">
		</td>
	</tr>
	</table>
</form>
</center>
<br>

<tr> 
<td align="center">
	<table border="0" width="90%" cellpadding="1" cellspacing="0" align="center">
	<tr> 
	<td>
	<a href="" onclick="frameloc('{ list_img_url_prev }'+prevpath);return false;"><img src="{ babSkinPath }images/Puces/parent.gif" border="0"></a>
	</td>
	<td  align="left" width="95%">
	<span id="sp" align="left"> </span>
	</td>
	</tr>
	</table>
</td>
</tr>
<table border="0" width="90%" cellpadding="3" cellspacing="0" align="center">
<tr> 
<td class="BabLoginMenuBackground">
<iframe name="files_frame" id="files_frame" style="width:100%;height:135px" src="{ list_img_url }" scrolling="auto" frameborder="0">
iframe : your browser is out off date
</iframe>
</td>
</tr>
<!--#if badmin -->
<tr> 
<td align="center" class="BabLoginMenuBackground">
	<table border="0" width="50%" cellpadding="2" cellspacing="0" align="center">
	<tr> 
	<td align="right">
	<input type="text" id="directory" size="30" maxlength="128">
	</td>
	<td align="left"><input type="button" value="{ create_folder }" onclick="make_dir();">
	</td>
	</tr>
	</table>
</td>
</tr>
<!--#endif badmin -->
</table>
<!--#end imageslisteditor -->

<!--#begin imageslist -->


<script type="text/javascript">
<!--
function confirm_url(url,msg)
	{
	if ( confirm(msg) )
		top.frames['files_frame'].location = url;
	}

function rename_popup(url,msg)
	{
	if ( confirm(msg) )
		window.open(url, 'rename','toolbar=no,menubar=no,personalbar=no,width=400,height=200,scrollbars=no,resizable=no');
	}


bab_initFunctions.push(function() {

	parent.prevpath = '{ prevpath }';parent.putpath('{ path }');
});

-->
</script>

<table border="0" cellspacing="0" cellpadding="2" align="left">
<tr>
<!--#in getnextufile -->
<td>
<table width="100" height="100" cellspacing="3" cellpadding="2" border="0">
<tr align="center">
<td valign="middle" class="BabTopicsAuthorBackground">
<!--#if gd -->
<a href="#" onclick="return parent.onOK('{ imgurl }');">
<img src="{ srcurl }" border="0" alt="{ imgname } - { imgalt }"></a>
<!--#else gd -->

<a href="#" onclick="return parent.onOK('{ imgurl }');">
<img src="{ srcurl }" width="{ imgwidth }" height="{ imgheight }" border="0" alt="{ imgname } - { imgalt }"></a>
<!--#endif gd -->
</td>
</tr>
<tr align="center"> 
<td valign="top" height="10" style="border:#CCCCCC 1px solid">
<table width="100%" height="10" cellspacing="0" cellpadding="0" border="0">
<tr><td nowrap>
<small>{ imgname_txt }</small>&nbsp;
</td>
<td align=right width="1%"><a class="BabSiteAdminListLink" href="javascript:confirm_url('{ delurl }','{ msg_delfile }')"><img src="{ babSkinPath }images/Puces/del.gif" alt="{ del }"  border="0"></a>
</td></tr></table>
</td>
</tr>
</table>
</td>
<!--#endin getnextufile -->
<!--#in getnextsubdir -->
<td>
<table width="100" height="100" cellspacing="3" cellpadding="2" border="0">
<tr align="center">
<td valign="middle">
	<a href="{ subdirurl }"><img src="{ babSkinPath }images/Puces/folder_big.gif" border="0" alt="{ subdirname }"></a>
</td>
</tr>
<tr align="center"> 
<td valign="top" height="10" style="border:#CCCCCC 1px solid">
	<table width="100%" height="10" cellspacing="0" cellpadding="0" border="0">
	<tr><td align="center" nowrap>
	<small>
	<!--#if badmin -->
	<a href="" onclick="rename_popup('{ rename_popup_url }','{ msg_renametree }');return false;">{ subdirname_txt }</a>
	<!--#else badmin -->
	{ subdirname_txt }
	<!--#endif badmin -->
	</small>&nbsp;
	<!--#if badmin -->
		</td>
		<td align=right width="1%"><a class="BabSiteAdminListLink" href="javascript:confirm_url('{ delurl }','{ msg_deltree }')"><img src="{ babSkinPath }images/Puces/del.gif" alt="{ del }"  border="0"></a>
		</td>
	<!--#endif badmin -->
	</tr></table>

</td>
</tr>
</table>
</td>
<!--#endin getnextsubdir -->
<!--#in getnextcfile -->
<td>
<table width="100" height="100" cellspacing="3" cellpadding="2" border="0">
<tr align="center">
<td valign="middle" class="BabLoginMenuBackground">
<!--#if gd -->
<a href="#" onclick="return parent.onOK('{ imgurl }');">
<img src="{ srcurl }" border="0" alt="{ imgname } - { imgalt }"></a>
<!--#else gd -->
<a href="#" onclick="return parent.onOK('{ imgurl }');">
<img src="{ srcurl }" width="{ imgwidth }" height="{ imgheight }" border="0" alt="{ imgname } - { imgalt }"></a>
<!--#endif gd -->
</td>
</tr>
<tr align="center"> 
<td valign="top" height="10" style="border:#CCCCCC 1px solid">
<table width="100%" height="10" cellspacing="0" cellpadding="0" border="0">
<tr><td align="center" nowrap>
<small>
	<!--#if badmin -->
	<a href="" onclick="rename_popup('{ rename_popup_url }','{ msg_renamefile }');return false;">{ imgname_txt }</a>
	<!--#else badmin -->
	{ imgname_txt }
	<!--#endif badmin -->
	</small>&nbsp;
</td>
<!--#if badmin -->
<td align=right width="1%"><a href="" onclick="confirm_url('{ delurl }','{ msg_delfile }');return false;"><img src="{ babSkinPath }images/Puces/del.gif" alt="{ del }"  border="0"></a>
</td>
<!--#endif badmin -->
</tr></table>
</td>
</tr>
</table>
</td>
<!--#endin getnextcfile -->
</tr>
</table>
	<form name="add_directory" method="post" action="{ babPhpSelf }" enctype="multipart/form-data">
	<input type="hidden" name="tg" value="images">
	<input type="hidden" name="idx" value="iframe">
	<input type="hidden" name="path" value="{ path }">
	<input type="hidden" name="directory" value="">
	<input type='submit' name='post_message' style='visibility:hidden'>
	</form>

	<form name="rename" method="post" action="{ babPhpSelf }" enctype="multipart/form-data">
	<input type="hidden" name="tg" value="images">
	<input type="hidden" name="idx" value="iframe">
	<input type="hidden" name="path" value="{ path }">
	<input type="hidden" name="old_name" value="">
	<input type="hidden" name="new_name" value="">
	<input type='submit' name='post_message' style='visibility:hidden'>
	</form>

<!--#end imageslist -->

<!--#begin rename_popup -->

<script type="text/javascript">
<!--
function rename_dir()
	{
	var frameform = opener.document.forms['rename'];
	var new_name = document.getElementById('dirname');
	frameform.path.value = '{ path }';
	frameform.old_name.value = '{ old_name }';
	frameform.new_name.value = new_name.value;
	frameform.post_message.click();
	window.close();
	}

window.focus();
-->
</script>

<table border="0" cellspacing="0" cellpadding="5" align="center" width="70%">
<tr>
	<td>
	&nbsp;
	</td>
</tr>
<tr>
	<td>
	<input type="text" id="dirname" name="dirname" size="33" maxlength="255" value="{ old_name }">
	</td>
</tr>
<tr>
	<td align="right">
	<input type="button" value="{ rename }" onclick="rename_dir();">
	</td>
</tr>
</table>

<!--#end rename_popup -->